<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="author" content="Laurence-042">
    
    
    
    
    
    
    <title>Python-MySQL数据查询 | Laurence</title>
    <link href=”https://laurence-042.github.io“ rel=”prefetch” />

    <link rel="stylesheet" href="/css/bootstrap.min.css">
<link rel="stylesheet" href="/css/aos.css">
<link rel="stylesheet" href="/css/style.css">
    <script src="/js/jquery.min.js"></script>
    <script src="/js/bootstrap.min.js"></script>
    <script src="/js/aos.js"></script>
    <script src="/js/highslide/highslide-full.min.js"></script>
    <link rel="stylesheet" href="/js/highslide/highslide.css">
    <style type="text/css">
        @media (max-width: 768px) {
            body {
                background-color: #f0f0f0;
                background: url('/imgs/xsbg.jpg');
                background-attachment: fixed;
            }
        }
    </style>
    
    <!--<script type="text/javascript">
      if (document.images) {
        var avatar = new Image();
        avatar.src = '/imgs/dr.png'
        var previews = 'http://bing.ioliu.cn/v1/rand'.split(',')
        var previewsPreLoad = []
        for(var i = 0; i < length; i++) {
          previewsPreLoad.push(new Image())
          previewsPreLoad[previewsPreLoad.length - 1].src = '/imgs/preview' + previews[i]
        }
      }
    </script>-->

    <!--highlight.js-->
    <link rel="stylesheet" href="//cdn.bootcss.com/highlight.js/9.2.0/styles/github.min.css">
    <script src="//cdn.bootcss.com/highlight.js/9.2.0/highlight.min.js"></script>
</head>
<body>
    <!-- 背景轮播图功能 -->
    <section class="hidden-xs">
    <ul class="cb-slideshow">
        <li><span>天若</span></li>
        <li><span>有情</span></li>
        <li><span>天亦老</span></li>
        <li><span>我为</span></li>
        <li><span>长者</span></li>
        <li><span>续一秒</span></li>
    </ul>
</section>
    <!-- 欧尼酱功能, 谁用谁知道 -->
    
    <header class="navbar navbar-inverse" id="gal-header">
    <div class="container">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed"
                    data-toggle="collapse" data-target=".bs-navbar-collapse"
                    aria-expanded="false">
                <span class="fa fa-lg fa-reorder"></span>
            </button>
            <a href="https://laurence-042.github.io">
                
                <style>
                    #gal-header .navbar-brand {
                        height: 54px;
                        line-height: 24px;
                        font-size: 28px;
                        opacity: 1;
                        background-color: rgba(0,0,0,0);
                        text-shadow: 0 0 5px #fff,0 0 10px #fff,0 0 15px #fff,0 0 20px #228DFF,0 0 35px #228DFF,0 0 40px #228DFF,0 0 50px #228DFF,0 0 75px #228DFF;
                    }
                </style>
                <!-- 这里使用文字(navbar_text or config.title) -->
                <div class="navbar-brand">Laurence</div>
                
            </a>
        </div>
        <div class="collapse navbar-collapse bs-navbar-collapse">
            <ul class="nav navbar-nav" id="menu-gal">
                
                
                <li class="">
                    <a href="/">
                        <i class="fa fa-home"></i>首页
                    </a>
                </li>
                
                
                
                <li class="">
                    <a href="/archives">
                        <i class="fa fa-archive"></i>归档
                    </a>
                </li>
                
                
                
                
                <li class="">
                    <a href="/categories">
                        <i class="fa fa-list"></i>分类
                    </a>
                </li>
                
                
                
                
                
                <li class="dropdown">
                    <!-- TODO 添加hover dropdown效果 -->
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown"
                       aria-haspopup="true" aria-expanded="false" data-hover="dropdown">
                        <i class="fa fa-tags"></i>标签
                    </a>
                    <ul class="dropdown-menu">
                        
                        
                        <li>
                            <a href="/tags/Java/">Java</a>
                        </li>
                        
                        <li>
                            <a href="/tags/笔记/">笔记</a>
                        </li>
                        
                        <li>
                            <a href="/tags/日常/">日常</a>
                        </li>
                        
                        <li>
                            <a href="/tags/纯记忆的学习笔记/">纯记忆的学习笔记</a>
                        </li>
                        
                        <li>
                            <a href="/tags/Python/">Python</a>
                        </li>
                        
                        <li>
                            <a href="/tags/不定期更新/">不定期更新</a>
                        </li>
                        
                        
                        <li>
                            <a href="/tags">...</a>
                        </li>
                        
                        
                    </ul>
                </li>
                
                
                
                
                <li class="">
                    <a href="/about">
                        <i class="fa fa-user"></i>关于我
                    </a>
                </li>
                
                
            </ul>
        </div>
    </div>
</header>
    <div id="gal-body">
        <div class="container">
            <div class="row">
                <div class="col-md-8 gal-right" id="mainstay">
                    
<article class="article well article-body" id="article">
    <div class="breadcrumb">
        <i class="fa fa-home"></i>
        <a href="https://laurence-042.github.io">Laurence</a>
        >
        <span>Python-MySQL数据查询</span>
    </div>
    <!-- 大型设备详细文章 -->
    <div class="hidden-xs">
        <div class="title-article">
            <h1>
                <a href="/2018/07/31/Python-MySQL数据查询/">Python-MySQL数据查询</a>
            </h1>
        </div>
        <div class="tag-article">
            
            <span class="label label-gal">
                <i class="fa fa-tags"></i>
                
                <a href="/tags/笔记/">笔记</a>, 
                
                <a href="/tags/Python/">Python</a>
                
            </span>
            
            <span class="label label-gal">
                <i class="fa fa-calendar"></i> 2018-07-31
            </span>
            
        </div>
    </div>
    <!-- 小型设备详细文章 -->
    <div class="visible-xs">
        <center>
            <div class="title-article">
                <h4>
                    <a href="/2018/07/31/Python-MySQL数据查询/">Python-MySQL数据查询</a>
                </h4>
            </div>
            <p>
                <i class="fa fa-calendar"></i> 2018-07-31
            </p>
            <p>
                
                <i class="fa fa-tags"></i>
                
                <a href="/tags/笔记/">笔记</a>, 
                
                <a href="/tags/Python/">Python</a>
                
                
                
            </p>
        </center>
    </div>
    <div class="content-article">
        <p>此处记录了这个鶸的第一个和数据库相关的用于查询远程数据库的python程序<br><a id="more"></a></p>
<p>若只想连接本地的MySQL数据库，直接看最下面的部分就行了，如果要连接远程数据库，你就需要进行一系列不算麻烦但绝对说不上简易的操作了······</p>
<p>前几天经历了一串令人智熄的操作后，总算折腾好了MySQL，然而结果竟然无法连接远程服务器的MySQL······ </p>
<p><del>这个鶸准备先在本地练下手，什么时候需要连接那个远程服务器之后再去找相应的方法</del></p>
<p>这个鶸发现了连接失败的问题所在：MySQL服务用的3306端口他喵的防被火墙给关了······</p>
<p>好吧，闲话说得够多了，下面进入正题，也就是连接远程数据库并查询其中的数据</p>
<hr>
<p>当然，你要连接一个数据库的话，首先数据库里要有数据才行<br>首先登陆数据库</p>
<pre><code class="shell">mysql -u root -p
</code></pre>
<blockquote>
<p>如果你用的是Windows，即使安装了MySQL并配置好了Path依旧可能会提示<code>&#39;mysql&#39;不是内部或外部命令，也不是可运行的程序或批处理文件。</code>此时以管理员权限运行CMD就可以执行<code>mysql</code>命令了。</p>
</blockquote>
<p>创建数据库(Database)</p>
<pre><code class="shell">CREATE DATABASE 数据库名;
</code></pre>
<p>本次创建一个名为<code>test0</code>的数据库：</p>
<pre><code class="shell">CREATE DATABASE test0;
</code></pre>
<p>创建数据表(Table)</p>
<pre><code class="shell">CREATE TABLE table_name (column_name column_type);
</code></pre>
<p>本次创建一个名为<code>testt</code>，有分别名为<code>testC</code>和<code>testC_re</code>的两列数据的数据表</p>
<blockquote>
<p>注意：应先指定操作的数据库再创建数据表</p>
</blockquote>
<pre><code class="shell">mysql&gt; use test0;
Database changed
mysql&gt; CREATE TABLE testt(
   -&gt; testC INT NOT NULL,
   -&gt; testC_re VARCHAR(100) NOT NULL
   -&gt; )ENGINE=InnoDB DEFAULT CHARSET=utf8;
</code></pre>
<p>出现类似<code>Query OK, 0 rows affected (0.16 sec)</code>的输出就说明创建过程成功结束了</p>
<blockquote>
<ul>
<li>NOT NULL，在操作数据库时如果输入该字段的数据为NULL ，就会报错。</li>
<li>AUTO_INCREMENT定义列为自增的属性，一般用于主键，数值会自动加1。</li>
<li>PRIMARY KEY关键字用于定义列为主键。 您可以使用多列来定义主键，列间以逗号分隔。</li>
<li>ENGINE 设置存储引擎</li>
<li>CHARSET 设置编码。</li>
</ul>
<p>更多的关于数据类型和指定属性的教程可以在<a href="http://www.runoob.com/mysql/mysql-data-types.html" target="_blank" rel="noopener">来自runoob的数据类型的教程</a>和<a href="http://www.runoob.com/mysql/mysql-create-tables.html" target="_blank" rel="noopener">来自runoob的创建数据表的教程</a>里面找到，本文仅作为第一次操作的引导写成，不包含任何非必要操作的详细介绍</p>
</blockquote>
<p>就这样，我们第一个数据表就建好了</p>
<p>现在往里面插入几条数据以便进行查询测试</p>
<pre><code class="shell">mysql&gt; INSERT INTO testt
    -&gt; (testC, testC_re)
    -&gt; VALUES
    -&gt; (1, &quot;test data&quot;);
</code></pre>
<p>出现类似<code>Query OK, 1 rows affected, 1 warnings (0.01 sec)</code>的输出就说明插入成功了</p>
<p>现在你的数据库中带查询数据就准备完成了</p>
<hr>
<p>但是！你还是要等一会才能愉快的敲python，因为你还没有一个有操作权限的用户（root不算，root默认只能从localhost访问，无法远程访问）</p>
<pre><code class="shell">mysql&gt; create user &#39;laurence042&#39;@&#39;localhost&#39; identified by &#39;[您没有查案此数据的权限]&#39;;
mysql&gt; GRANT ALL PRIVILEGES ON *.* TO &#39;laurence042&#39;@&#39;%&#39;;
</code></pre>
<p>这段设置里，我的用来进行数据库管理的用户名是<code>laurence042</code>，并设置成<code>可从任意IP访问</code>。将<code>&#39;%&#39;</code>换成类似<code>&#39;127.0.0.1&#39;</code>这样的IP就可以限定用户只能从这个IP进行访问。至于<code>&#39;[您没有查案此数据的权限]&#39;</code>······这是我的密码诶，怎么可能让你看呢（笑）如果你恰好认识我而且想要的话，可以当面找我要，这样的话我就能当面嘲笑你了（手动滑稽）</p>
<p>为保险起见，防止和这个鶸犯一样的白痴错误，你最好先检查下防火墙那边<code>3306</code>端口的状态。</p>
<p>不同操作系统的防火墙相关指令不一样，以这个鶸在用的Centos7为例，CentOS7的默认防火墙为firewall<br>首先查看firewall启动情况</p>
<pre><code class="shell">systemctl status firewalld
</code></pre>
<p>如果没有启动，那最好还是启动一下，毕竟防火墙还是挺重要的······用下面的命令启动防护墙</p>
<pre><code class="shell">systemctl start firewalld
</code></pre>
<p>查看一下<code>3306</code>端口是否已经开启，如果显示<code>yes</code>,则表示防火墙已开启该端口（没错，这个鶸的显示的是<code>no</code>）</p>
<pre><code class="shell">firewall-cmd --query-port=3306/tcp 
</code></pre>
<p>如果你和这个鶸一样看到了<code>no</code>，那么，开启开启<code>3306</code>端口</p>
<pre><code>firewall-cmd --zone=public --add-port=3306/tcp --permanent
</code></pre><p>然后重启防火墙使刚刚的打开端口的操作生效</p>
<pre><code>firewall-cmd --reload
</code></pre><blockquote>
<p>当然也可以关闭centos7的默认防火墙<br><code>systemctl stop firewalld</code><br>和禁用防火墙<br><code>systemctl mask firewalld</code><br>然后使用iptables防火墙，centos7默认是没有安装iptables的，使用<br><code>yum install iptables</code><br><code>yum install iptables-services</code><br>两步进行安装即可。<br>可以参考<a href="http://www.cnblogs.com/anne32184/" target="_blank" rel="noopener">@anne的夏天</a>大佬的这篇关于详细iptables安装配置和讲解的教程<a href="https://www.cnblogs.com/anne32184/p/5961806.html" target="_blank" rel="noopener">CentOS7安装iptables防火墙</a>进行安装配置</p>
</blockquote>
<p>如果之后还使出了问题······问度娘（baidu）或谷哥（Google）吧，这个鶸也不知道怎么办了······</p>
<hr>
<p>接下来就能用python进行数据库中数据的读操作了，注释很详细，就不赘述了</p>
<p>值得一提的是，代码里连接的是本地服务器（<code>127.0.0.1</code>），所以可以安装完MySQL就直接用root连接，如果是远程服务器，用前文的步骤创建一个可以在你的IP地址连接的用户进行连接</p>
<pre><code class="python">import mysql.connector  # 首先导入包，没有的话用pip安装相应的包或用IDE解决

config = {
    &#39;host&#39;: &#39;127.0.0.1&#39;,  # 服务器地址，本次测试连接的是本地服务器
    &#39;user&#39;: &#39;root&#39;,  # 用来访问MySQL数据库的用户名
    &#39;password&#39;: &#39;[您没有查案此数据的权限]&#39;,  # 用来访问MySQL数据库的用户的密码
    &#39;port&#39;: 3306,  # MySQL数据库所用的端口号，默认是3305
    &#39;database&#39;: &#39;test0&#39;,  # 数据库名称
    &#39;charset&#39;: &#39;utf8&#39;  # 编码
}
try:
    cnn = mysql.connector.connect(**config)  # 连接数据库
except mysql.connector.Error as e:
    print(&#39;connect fails!{}&#39;.format(e))
cursor = cnn.cursor()
try:
    &#39;&#39;&#39;
    此段代码用于获取并输出数据
    sql_query为请求数据字符串
    此处的字符串含义为“获取当前数据库中名为“testt”的数据表中名字分别为“testC”和“testC_re”的两列数据
    &#39;&#39;&#39;
    sql_query = &#39;select testC,testC_re from testt ;&#39;
    cursor.execute(sql_query)
    for testC, testC_re in cursor:
        print(testC, testC_re)
except mysql.connector.Error as e:
    print(&#39;query error!{}&#39;.format(e))
finally:
    cursor.close()  # 不要忘记关闭连接
    cnn.close()

</code></pre>
<hr>
<!--more-->

    </div>
</article>


<div id="comments-template"></div>
<link rel="stylesheet" href="https://imsun.github.io/gitment/style/default.css">
<script>
	if(!window.commentConfig) {
      window.commentConfig = {}
      window.commentConfig.title = 'Python-MySQL数据查询'
    }
</script>

                </div>
                <aside class="col-md-4 gal-left" id="sidebar">
    <!-- 此为sidebar的搜索框, 非搜索结果页面 -->
<aside id="sidebar-search">
    <div class="search hidden-xs" data-aos="fade-up" data-aos-duration="2000">
        <form class="form-inline clearfix" id="search-form" method="get"
              action="/search/index.html">
            <input type="text" name="s" class="form-control" id="searchInput" placeholder="搜索文章~">
            <button class="btn btn-danger btn-gal" type="submit">
                <i class="fa fa-search"></i>
            </button>
        </form>
    </div>
</aside>
    <aside id="sidebar-author">
    <div class="panel panel-gal" data-aos="flip-right" data-aos-duration="3000">
        <div class="panel-heading" style="text-align: center">
            <i class="fa fa-quote-left"></i>
            Laurence-042
            <i class="fa fa-quote-right"></i>
        </div>
        <div class="author-panel text-center">
            <img src="/imgs/dr.png" width="140" height="140"
                 alt="个人头像" class="author-image">
            <p class="author-description"></p>
        </div>
    </div>
</aside>
    
    <aside id="sidebar-recent_comments">
    <div class="panel panel-gal recent hidden-xs" data-aos="fade-up" data-aos-duration="2000">
        <div class="panel-heading">
            <i class="fa fa-comments"></i>
            最新评论
            <i class="fa fa-times-circle panel-remove"></i>
            <i class="fa fa-chevron-circle-up panel-toggle"></i>
        </div>
        <ul class="list-group list-group-flush"></ul>
    </div>
</aside>
    
    <!-- 要配置好leancloud才能开启此小工具 -->
    
    
    <aside id="sidebar-recent_posts">
    <div class="panel panel-gal recent hidden-xs" data-aos="fade-up" data-aos-duration="2000">
        <div class="panel-heading">
            <i class="fa fa-refresh"></i>
            近期文章
            <i class="fa fa-times-circle panel-remove"></i>
            <i class="fa fa-chevron-circle-up panel-toggle"></i>
        </div>
        <ul class="list-group list-group-flush">
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2018/10/08/一个鶸的自我修养/">一个鶸的自我修养</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2018/10/08/hello-world/">Hello World</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2018/08/08/给真·小白的关于初用远程Linux系统的简单入门/">给真·小白的关于初用远程Linux系统的简单入门</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2018/08/02/令新人各种懵逼的各种概念/">令新人各种懵逼的各种概念</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2018/07/31/Python-MySQL数据查询/">Python-MySQL数据查询</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2018/07/28/Python笔记-这个鶸仍未搞明白的东西/">Python笔记-这个鶸仍未搞明白的东西</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2018/07/26/Python笔记-特殊变量/">Python笔记-特殊变量</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2018/07/25/Fullmetal Alchemist!!!/">Fullmetal Alchemist!!!</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2018/07/23/Python笔记-陌生的lambda/">Python笔记-陌生的lambda</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2018/07/22/DFS-BFS学习笔记/">DFS,BFS学习笔记</a>
                </span>
            </li>
            
        </ul>
    </div>
</aside>
    
    
    <aside id="sidebar-rand_posts">
    <div class="panel panel-gal recent hidden-xs" data-aos="fade-up" data-aos-duration="2000">
        <div class="panel-heading">
            <i class="fa fa-refresh"></i>
            随机文章
            <i class="fa fa-times-circle panel-remove"></i>
            <i class="fa fa-chevron-circle-up panel-toggle"></i>
        </div>
        <ul class="list-group list-group-flush">
            
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2018/07/22/DFS-BFS学习笔记/">DFS,BFS学习笔记</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2018/07/25/Fullmetal Alchemist!!!/">Fullmetal Alchemist!!!</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2018/07/07/JavaDoc语法/">JavaDoc语法</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2018/07/18/JavaGUI-Swing学习笔记/">JavaGUI_Swing学习笔记</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2018/07/28/Python笔记-这个鶸仍未搞明白的东西/">Python笔记-这个鶸仍未搞明白的东西</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2018/10/08/hello-world/">Hello World</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2018/10/08/一个鶸的自我修养/">一个鶸的自我修养</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2018/07/19/关于在Vultr上折腾MySQL的那些事/">关于在Vultr上折腾MySQL的那些事</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2018/06/30/各种杂项（不定期更新）/">各种杂项（不定期更新）</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2018/06/30/文字处理工具（不定期更新）/">文字处理工具（不定期更新）</a>
                </span>
            </li>
            
        </ul>
    </div>
</aside>
    
    
    <aside id="gal-sets">
        <div class="panel panel-gal hidden-xs" data-aos="fade-up" data-aos-duration="2000">
            <ul class="nav nav-pills pills-gal">
                <li class="">
                    <a href="/2018/07/31/Python-MySQL数据查询/index.html#sidebar-tags" data-toggle="tab" id="tags-tab">热门标签</a>
                </li>
                <li class="">
                    <a href="/2018/07/31/Python-MySQL数据查询/index.html#sidebar-friend-links" data-toggle="tab" id="friend-links-tab">友情链接</a>
                </li>
                <li class="">
                    <a href="/2018/07/31/Python-MySQL数据查询/index.html#sidebar-links" data-toggle="tab" id="links-tab">个人链接</a>
                </li>
            </ul>
            <div class="tab-content">
                <div class="cloud-tags tab-pane nav bs-sidenav fade" id="sidebar-tags">
    
    <a href="/tags/Java/" style="font-size: 14.794550865184593px;" class="tag-cloud-link">Java</a>
    
    <a href="/tags/笔记/" style="font-size: 11.233597819255209px;" class="tag-cloud-link">笔记</a>
    
    <a href="/tags/日常/" style="font-size: 11.091775092147628px;" class="tag-cloud-link">日常</a>
    
    <a href="/tags/纯记忆的学习笔记/" style="font-size: 14.710077941581407px;" class="tag-cloud-link">纯记忆的学习笔记</a>
    
    <a href="/tags/Python/" style="font-size: 8.668514095875045px;" class="tag-cloud-link">Python</a>
    
    <a href="/tags/不定期更新/" style="font-size: 16.692901735436806px;" class="tag-cloud-link">不定期更新</a>
    
    <a href="/tags/hey/" style="font-size: 16.40349957870203px;" class="tag-cloud-link">hey!</a>
    
    <a href="/tags/报错解决方案/" style="font-size: 17.14368444459779px;" class="tag-cloud-link">报错解决方案</a>
    
    <a href="/tags/MySQL/" style="font-size: 14.399769992543558px;" class="tag-cloud-link">MySQL</a>
    
    <a href="/tags/服务器/" style="font-size: 14.493001879860246px;" class="tag-cloud-link">服务器</a>
    
    <a href="/tags/工具/" style="font-size: 16.678839052224504px;" class="tag-cloud-link">工具</a>
    
    <a href="/tags/hexo/" style="font-size: 14.877259190098782px;" class="tag-cloud-link">hexo</a>
    
    <a href="/tags/bat/" style="font-size: 11.807640346104813px;" class="tag-cloud-link">bat</a>
    
    <a href="/tags/偷懒/" style="font-size: 18.377457533405547px;" class="tag-cloud-link">偷懒</a>
    
    <a href="/tags/真·小白/" style="font-size: 12.53258406997469px;" class="tag-cloud-link">真·小白</a>
    
    <a href="/tags/Linux/" style="font-size: 8.899597443505618px;" class="tag-cloud-link">Linux</a>
    
</div>
                <div class="friend-links tab-pane nav bs-sidenav fade" id="sidebar-friend-links">
    
    <li>
        <a href="http://kdays.net/days/" target="_blank">KDays Forum</a>
    </li>
    
    <li>
        <a href="http://www.gal123.com/" target="_blank">绅士导航♂</a>
    </li>
    
    <li>
        <a href="http://www.moe123.com/" target="_blank">萌导航</a>
    </li>
    
    <li>
        <a href="https://google.jiongjun.cc/" target="_blank">Google镜像站</a>
    </li>
    
</div>
                <div class="links tab-pane nav bs-sidenav fade" id="sidebar-links">
    
    <li>
        <a href="https://github.com/Laurence-042" target="_blank">Github</a>
    </li>
    
    <li>
        <a href="http://localhost:4000/" target="_blank">null,没有更多的了</a>
    </li>
    
</div>
            </div>
        </div>
    </aside>
    
</aside>
            </div>
        </div>
    </div>
    <footer id="gal-footer">
    <div class="container">
        Copyright © 2018 Laurence-042 Powered by <a href="https://hexo.io/" target="_blank">Hexo</a>.&nbsp;Theme by <a href="https://github.com/ZEROKISEKI" target="_blank">AONOSORA</a>
    </div>
</footer>

<!-- 回到顶端 -->
<div id="gal-gotop">
    <i class="fa fa-angle-up"></i>
</div>
</body>
<script src="/js/activate-power-mode.js"></script>
<script>

    // 配置highslide
	hs.graphicsDir = '/js/highslide/graphics/'
    hs.outlineType = "rounded-white";
    hs.dimmingOpacity = 0.8;
    hs.outlineWhileAnimating = true;
    hs.showCredits = false;
    hs.captionEval = "this.thumb.alt";
    hs.numberPosition = "caption";
    hs.align = "center";
    hs.transitions = ["expand", "crossfade"];
    hs.lang.number = '共%2张图, 当前是第%1张';
    hs.addSlideshow({
      interval: 5000,
      repeat: true,
      useControls: true,
      fixedControls: "fit",
      overlayOptions: {
        opacity: 0.75,
        position: "bottom center",
        hideOnMouseOut: true
      }
    })

    // 初始化aos
    AOS.init({
      duration: 1000,
      delay: 0,
      easing: 'ease-out-back'
    });

</script>
<script>
	POWERMODE.colorful = 'true';    // make power mode colorful
	POWERMODE.shake = 'true';       // turn off shake
	// TODO 这里根据具体情况修改
	document.body.addEventListener('input', POWERMODE);
</script>
<script>
    window.slideConfig = {
      prefix: '/imgs/slide/background',
      ext: 'jpg',
      maxCount: '6'
    }
</script>
<script src="/js/hs.js"></script>
<script src="/js/blog.js"></script>



<script src="https://imsun.github.io/gitment/dist/gitment.browser.js"></script>
<script>
    if(window.commentConfig) {
      window.commentConfig.id = 'Tue Jul 31 2018 16:03:33 GMT+0000'
      window.commentConfig.owner = 'Laurence-042'
      window.commentConfig.repo = 'blog-comment'
      window.commentConfig.client_id = '41ecdf7be074fb66a1a2'
      window.commentConfig.client_secret = '2382f17284dc9ba9754020431735338ce8d80ec0'
      window.commentConfig.redirect_uri = ''
    } else {
      window.commentConfig = {
      	id: 'Tue Jul 31 2018 16:03:33 GMT+0000',
        owner: 'Laurence-042',
        repo: 'blog-comment',
        client_id: '41ecdf7be074fb66a1a2',
        client_secret: '2382f17284dc9ba9754020431735338ce8d80ec0',
        redirect_uri: ''
      }
    }
</script>

<!--highlight.js-->
<script>
    hljs.initHighlightingOnLoad();
</script>
<script src="/js/comment/gitment.js"></script>

</html>